#ifndef BLEEDTHROUGHINTENSITYEVAL_HPP
#define BLEEDTHROUGHINTENSITYEVAL_HPP

#include "GlobalMesureTemplateMethod.hpp"



/*!
* \brief This class Mesure the quantity of bleed through that may appear on the recto image.
*
* Let \f$ I^{verso}_{ink} \f$ be the set of pixel resulting from the ink segmentation of the verso side.
 \f{eqnarray}{
       I^{verso}_{ink} &=& \{ I^{verso} \left( i,j \right) < \mathcal{T} \mid 0<i<W;0<j<H \}
  \f}
 Let \f$ I^{recto}_{ink} \f$ be the set of pixel resulting from the ink segmentation of the recto side.
 \f{eqnarray}{
       I^{recto}_{ink} &=& \{ I^{recto} \left( i,j \right) < \mathcal{T} \mid 0<i<W;0<j<H \}
  \f}

\f{eqnarray}{
   \stackrel{\mathcal{M}}{Intensity} &=& \frac{\sum\limits{i \in 0..card(I^{verso}_{ink})} I^{verso}_{ink} \setminus I^{rerso}_{ink}}
                                              {card \left( I^{rerso}_{ink} \right)}
\f}
*/
class EvalBleedThroughIntensity2Ink : public GlobalMesureTemplateMethod
{
public :
    EvalBleedThroughIntensity2Ink(const girl::tools::Image &verso)
        :_verso(verso),
        _ndgInk(-1)
    {}
    virtual float evaluate(const girl::tools::Image &image);

    std::string getName()
    {return "Intensity";}

private :
    float ndgMoyen(const girl::regionDeque &regions, const girl::toger &tog);
    const girl::tools::Image &_verso;
    int _ndgInk;

};


#endif // BLEEDTHROUGHINTENSITYEVAL_HPP
